﻿using SmartPlant.Model;
using SmartPlant.Model.Biz;
using SmartPlant.Model.DbContext.Biz;
using SmartPlant.WinCore;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace SmartPlant.Services.Interfaces
{
    /// <summary>
    /// 动态获取数据接口
    /// </summary>
    public interface IDynamicDataApi
    {
        #region IndexTable
        ///// <summary>
        ///// 从JSON文本中加载索引表数据。
        ///// </summary>
        ///// <param name="jsonStr"></param>
        ///// <returns></returns>
        //Task<dynamic> LoadIndexTableFromJsonAsync(string jsonStr);

        /// <summary>
        /// 保存索引表数据。
        /// </summary>
        /// <param name="proId">工程ID。</param>
        /// <param name="submitObj"></param>
        /// <returns></returns>
        Task<bool> SaveIndexTableAsync(string proId, EDESubmitObj submitObj);

        /// <summary>
        /// 获取索引表动态类属性信息。
        /// </summary>
        /// <param name="proId">工程ID。</param>
        /// <returns></returns>
        Task<List<DynamicPropertyInfo>> InitIndexTablePropertyInfosAsync(string proId);
        /// <summary>
        /// 分页获取索引表动态数据。
        /// </summary>
        /// <param name="unitids"></param>
        /// <param name="pagenum"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        Task<PageResult<dynamic>> GetIndexTableDynamicsAsync(string proId,List<ViewQueryItemAttr> ColsChecked, string unitids, int pagenum, int pagesize);
        /// <summary>
        /// 获取索引表动态数据对应的数据列。
        /// </summary>
        /// <returns></returns>
        Task<List<ViewQueryItemAttr>> GetIndexTableDataColumnsAsync(string proId); 
        /// <summary>
        /// 初始化索引表属性下拉列表选项列表。
        /// </summary>
        /// <param name="ProjId"></param>
        /// <param name="propertyInfos"></param>
        /// <returns></returns>
        Task<bool> InitIndexTablePropertyDropDownListAsync(string ProjId, List<DynamicPropertyInfo> propertyInfos);


        
        #endregion

        #region DrawingDoc
        /// <summary>
        /// 获取图形文档动态类属性信息。
        /// </summary>
        /// <param name="proId">工程ID。</param>
        /// <returns></returns>
        Task<List<DynamicPropertyInfo>> InitDrawingDocPropertyInfosAsync(string proId);
        /// <summary>
        /// 分页获取图形文档数据。
        /// </summary>
        /// <param name="pagenum"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        Task<PageResult<List<Drawing>>> GetDrawingDocDynamicsAsync(string proId, int pagenum, int pagesize);

        /// <summary>
        /// 获取图形文档动态数据对应的数据列。
        /// </summary>
        /// <returns></returns>
        Task<List<ViewQueryItemAttr>> GetDrawingDocDataColumnsAsync(string proId);
        #endregion
    }
}
